-
Notifications
You must be signed in to change notification settings - Fork 489
Upsert testing plan #4470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For the callback cases, maybe also check that
This needs to check that is also throws if the key is already present (thus it does not try to call the callback). (sorry I didn't read the tests, these are just drive-by comments about this list) |
In |
Checking the state would mean to check that the keys and values are what we expect, with what we expect depending on whether the callback mutates the map or not? |
yep |
Thanks for putting this together! I'd suggest one more case for |
Map.prototype.getOrInsert tests were merged in #4472 |
Turns out there was already coverage for this case in overwrites-mutation-from-callback.js. |
Map.prototype.getOrInsertComputed tests: #4491 |
Uh oh!
There was an error while loading. Please reload this page.
Proposal: https://github.com/tc39/proposal-upsert
Rendered specification text: https://tc39.es/proposal-upsert/
Implementations: engine262, SpiderMonkey
Map.getOrInsert
this
is a Setthis
is a WeakMapthis
is does not have a [[MapData]] slotgetOrInsert
length
ofgetOrInsert
name
ofgetOrInsert
getOrInsert
is not a constructorkey
is not presentkey
is presentkey
this
is not an ObjectMap.getOrInsertComputed
this
is undefined and the callback receives exactly one argumentthis
is a Setthis
is a WeakMapthis
is does not have a [[MapData]] slotgetOrInsertComputed
length
ofgetOrInsertComputed
name
ofgetOrInsertComputed
getOrInsertComputed
is not a constructorgetOrInsertComputed
if the callback throwsgetOrInsertComputed
if the callback mutates the Map and then throwskey
is not presentkey
is presentkey
this
is not an ObjectWeakMap.getOrInsert
this
does not have a [[WeakMapData]] slotgetOrInsert
length
ofgetOrInsert
name
ofgetOrInsert
getOrInsert
is not a constructorkey
is not presentkey
is not presentkey
is presentkey
is presentthis
is not an ObjectWeakMap.getOrInsertComputed
this
is undefined and the callback receives exactly one argumentthis
does not have a [[WeakMapData]] slotgetOrInsertComputed
length
ofgetOrInsertComputed
name
ofgetOrInsertComputed
getOrInsertComputed
is not a constructorgetOrInsertComputed
if the callback throwsgetOrInsertComputed
if the callback mutates the WeakMap and then throwskey
is not presentkey
is not presentkey
is presentkey
is presentthis
is not an ObjectThe text was updated successfully, but these errors were encountered: